/**
 * related to home.ui
 * 
 * @Author : wzgl5533
 * @Timestamp : 2017-07-19
 */
var nf = sm("do_Notification");
var do_App = sm("do_App");
var do_Page = sm("do_Page");
var do_Global = sm("do_Global");
var do_Network = sm("do_Network");
var dataCache = sm("do_DataCache");
var preseter = require("source://view/home/presenter");
//组件
var prayFather = ui("do_LinearLayout_pray");
var prayImage = ui("do_ImageView_pray");
var prayLabel = ui("do_Label_pray");

var bestowFather = ui("do_LinearLayout_bestow");
var bestowImage = ui("do_ImageView_bestow");
var bestowLabel = ui("do_Label_bestow");

var personalFather = ui("do_LinearLayout_personal");
var personalImage = ui("do_ImageView_personal");
var personalLabel = ui("do_Label_personal");

var do_ViewShower_mian = ui("do_ViewShower_mian");

//添加监听器以及绑定页面
preseter.initBottom({
	father: prayFather,
	image:prayImage,
	label:prayLabel
}, {
	father: bestowFather,
	image: bestowImage,
	label: bestowLabel
}, {
	father: personalFather,
	image: personalImage,
	label:personalLabel
},do_ViewShower_mian);














// 当前页面下，订阅android系统返回键的事件：3秒内连续点击两次退出应用
var canBack = false;
var delay3 = mm("do_Timer");

delay3.delay = 3000;
delay3.on("tick", function() {
	delay3.stop();
	canBack = false;
});
do_Page.on("back", function() {
	if (canBack) {
		do_App.closePage();
	} else {
		nf.toast("再次点击退出应用");
		canBack = true;
		delay3.start();
	}
});